﻿// AtlPropertyPage.cpp: CAtlPropertyPage 的实现

#include "pch.h"
#include "AtlPropertyPage.h"

// CAtlPropertyPage

HRESULT __stdcall CAtlPropertyPage::Apply()
{
    for (UINT i = 0; i < m_nObjects; i++)
    {
        CComQIPtr<IAtlControl, &IID_IAtlControl> lpAtlControl(m_ppUnk[i]);
        TCHAR Buff[0x30] = { 0 };
        UINT re = GetDlgItemText(IDC_EDIT_STRING, Buff, 0x30);
        BSTR lpbString = SysAllocString(Buff);
        HRESULT hResult = lpAtlControl->put_String(lpbString);
        SysFreeString(lpbString);
        if (hResult != S_OK)
        {
            return S_FALSE;
        }
    }

    return S_OK;
}

LRESULT CAtlPropertyPage::OnEnChangeEdit(WORD, WORD, HWND, BOOL&)
{
    SetDirty(TRUE);
    return 0;
}
